package myoa

import myoa.domain.ExpenseGroupStatus
import myoa.domain.ExpenseGroupType
import myoa.domain.Trace

class ExpenseGroup extends Trace {
    String name

    ExpenseGroupType type
    ExpenseGroupStatus status
    //审批
    User approvedBy
    Date approvedDate

    //发放
    User writeoffBy
    Date writeoffDate

    static hasMany = [expenseDetails: ExpenseDetail]

    static constraints = {
        name(blank: false, unique: 'createdBy')
        approvedBy(nullable: true)
        approvedDate(nullable: true)
        writeoffBy(nullable: true)
        writeoffDate(nullable: true)
    }
}
